<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.reapal.config.*"%>
<%@ page import="com.reapal.utils.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.math.BigDecimal"%>
<%@ page import="com.alibaba.fastjson.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  </head>
  <%
  		
	  //卡号
  	  String card_no = request.getParameter("card_no").trim();
  	  //姓名
      String owner = new String(request.getParameter("owner").trim().getBytes("ISO-8859-1"),"utf-8");
  	  //会员id
  	  String member_id = request.getParameter("member_id").trim();
  	  //证件号
  	  String cert_no = request.getParameter("cert_no").trim();
  	  //手机号
  	  String phone = request.getParameter("phone").trim();
  	  //订单金额
  	  String total_fee = request.getParameter("total_fee").trim();
  	 
  	  
  	Map<String,String> map = new HashMap<String, String>();
	  map.put("merchant_id", ReapalConfig.merchant_id);
	  map.put("version", ReapalConfig.version);
	  map.put("card_no", card_no);
	  map.put("owner", owner);
	  map.put("cert_type", "01");
	  map.put("cert_no", cert_no);
	  map.put("phone", phone);
	  map.put("order_no", new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));
	  map.put("transtime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
	  map.put("currency", "156");
	  map.put("title", "yyyyy");
	  map.put("body", "yyyy");
	  map.put("member_id", member_id);
	  map.put("terminal_type", "mobile");
	  map.put("terminal_info", "dddss-daddd");
	  map.put("notify_url", ReapalConfig.notify_url);
	  map.put("member_ip", "192.168.1.83");
	  map.put("seller_email", ReapalConfig.seller_email);
      map.put("token_id", ReapalUtil.getUUID());
	  BigDecimal amount = new BigDecimal(total_fee.toString()).movePointRight(2);			
	  map.put("total_fee", amount.toString());
	  String url = "/fast/same/debit/portal";
	  
	  String post = ReapalSubmit.buildSubmit(map, url);

      System.out.println("返回结果post==========>" + post);
      
      //解密返回的数据
      String res = Decipher.decryptData(post);
  %>
  <body>
		
		<%=res%>
  </body>
</html>
